package com.example.backend.service.mysql.permission.impl;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.backend.entitly.mysql.permission.Roles;
import com.example.backend.mapper.mysql.permission.RolesMapper;
import com.example.backend.service.mysql.permission.RolesService;
import org.springframework.stereotype.Service;

/**
 * @author 1
 * @description 针对表【roles(角色表)】的数据库操作Service实现
 * @createDate 2025-06-04 09:01:52
 */
@Service
public class RolesServiceImpl extends ServiceImpl<RolesMapper, Roles>
        implements RolesService {


    @Override
    public Integer getByDefaultName() {
        return new LambdaQueryChainWrapper<>(getBaseMapper())
                .eq(Roles::getDefaultRole, 1)
                .one().getRoleId();
    }

    @Override
    public Roles getByNotUser() {
        return new LambdaQueryChainWrapper<>(getBaseMapper())
                .eq(Roles::getDataScope, 4)
                .one();
    }
}




